package cs236369.hw5;

import java.sql.Date;

public class Mission extends Post {

	/**
	 * 
	 * @param id
	 * @param owner
	 * @param creationTime
	 * @param name
	 * @param capacity
	 * @param content
	 * @param latitude
	 * @param longitude
	 * @param skills
	 * @throws RescueMeException
	 */
	public Mission(int id, String owner, Date creationTime, String name, int capacity,
			String content, double latitude, double longitude,
			Skill[] skills) throws RescueMeException {
		super(id, owner, creationTime, name, capacity, content, latitude,
				longitude, skills);
	}
	
	/**
	 * 
	 * @param id
	 * @param owner
	 * @param creationTime
	 * @param name
	 * @param capacity
	 * @param content
	 * @param latitude
	 * @param longitude
	 * @param skills
	 * @throws RescueMeException
	 */
	public Mission(int id, String owner, Date creationTime, String name, int capacity,
			String content, double latitude, double longitude, Skill[] skills,
			Team[] teamsJoined) throws RescueMeException {
		this(id, owner, creationTime, name, capacity, content, latitude,
				longitude, skills);
		this.teamsJoined = teamsJoined;
	}
	
	/**
	 * 
	 * @return the teams joined to the mission
	 */
	public Team[] getTeamsJoined() {
		if(teamsJoined == null) {
			teamsJoined = new Team[0];
		}
		return teamsJoined;
	}

	private Team[] teamsJoined;
}
